﻿using XNAFight.Scene.Core;
using Microsoft.Xna.Framework;
using Microsoft.Xna.Framework.Graphics;
using Microsoft.Xna.Framework.Input;
using XNAFight.Players;
using System;
using System.Collections.Generic;
using XNAFight.Engine;

namespace XNAFight.Scene.Core
{
    class DebugMouse : Screen
    {
        private Vector2 posMouse;
        private MouseState mouse_state;
        private string text;
                
        public DebugMouse()
            : base()
        {
            posMouse = new Vector2(0.0f, 0.0f);
            text = "";
        }

        public override void Reset()
        {
        }

        public override void Update(GameTime _game_time)
        {
            base.Update(_game_time);

            mouse_state = Mouse.GetState();

            

            posMouse = new Vector2(mouse_state.X, mouse_state.Y);

            text = "  (" + posMouse.X.ToString() + "; " + posMouse.Y.ToString() + ")";
        }

        public override void Draw(GameTime gameTime)
        {
            base.Draw(gameTime);

            

            CommonContent.SpriteBatch.Begin();

            CommonContent.SpriteBatch.DrawString(CommonContent.SmallFont, text, posMouse, Color.Black, 0.0f, Vector2.Zero, 1.0f, SpriteEffects.None, 0.5f);


            CommonContent.SpriteBatch.End();
        }

        public override void HandleInputs()
        {

        }

        public override void Add()
        {
            
            base.Add();

            Game.IsMouseVisible = true;
            
        }

        protected override void Remove()
        {
            base.Remove();

            Game.IsMouseVisible = false;
        }

    }
}
